package com.hit.aircraftwar.creator;

import com.hit.aircraftwar.activity.MainActivity;
import com.hit.aircraftwar.aircraft.Boss;
import com.hit.aircraftwar.application.ImageManager;
import com.hit.aircraftwar.basic.AbstractFlyingObject;
import com.hit.aircraftwar.setter.ParameterSet;
import com.hit.aircraftwar.strategy.ShootStrategy;
import com.hit.aircraftwar.strategy.SpreadShootStrategy;

/**
 * @author LiuYuZhe
 */
public class BossCreator implements Creator {

    /**
     * BOSS默认基础参数
     */
    private final int SpeedY = 1;
    private final ShootStrategy shootStrategy = new SpreadShootStrategy();
    private final int direction = 1;
    private final int shootNum = 3;

    @Override
    public AbstractFlyingObject creatObject(int locationX, int locationY) {
        return new Boss(
                locationX,
                locationY,
                ParameterSet.getInstance().getBossSpeedX(),
                this.SpeedY,
                ParameterSet.getInstance().getBossHp(),
                this.shootStrategy,
                this.direction,
                ParameterSet.getInstance().getBossPower(),
                this.shootNum
        );
    }

    @Override
    public AbstractFlyingObject creatObject() {
        return new Boss(
                (int)(Math.random() * (MainActivity.width - ImageManager.getWidth(ImageManager.MOB_ENEMY_IMAGE))),
                0,
                ParameterSet.getInstance().getBossSpeedX(),
                this.SpeedY,
                ParameterSet.getInstance().getBossHp(),
                this.shootStrategy,
                this.direction,
                ParameterSet.getInstance().getBossPower(),
                this.shootNum
        );
    }
}
